from selenium import webdriver
from selenium.webdriver.common.by import By
import time
from selenium.webdriver.support.wait import WebDriverWait


driver =webdriver.Chrome()
driver.get('https://www.baidu.com')

func = lambda x : True if x.title=='百度一下,你就知道' else False


#找到True
result=WebDriverWait(driver,10,1).until(lambda x : True if x.title=='百度一下，你就知道' else False,message='标题不对应')
print(result)
result1=WebDriverWait(driver,5).until_not(func,message='不对应')
print(result1)


time.sleep(2)
driver.quit()


